#ifndef CAMERA_H
#define CAMERA_H

#include "Vector3.h"
#include "Matrix.h"

namespace Cvekas {

/// Abstaract camera
class Camera : public boost::noncopyable
{
public:
	virtual ~Camera() {};

	virtual Matrix getViewMatrix() const = 0;
	virtual Vector3 getPosition() const = 0;
	virtual Vector3 getDirection() const = 0;
	virtual Vector3 getUp() const = 0;
};

/// Simple camera where position, direction and up vectors must be set directly.
class SimpleCamera : public Camera
{
public:
	SimpleCamera(const Vector3& pos, const Vector3& dir, const Vector3& up);
	virtual ~SimpleCamera() {};

	virtual Matrix getViewMatrix() const;
	
	virtual Vector3 getPosition() const;
	virtual Vector3 getDirection() const;
	virtual Vector3 getUp() const;

	void setPosition(const Vector3& pos);
	void setDirection(const Vector3& dir);
	void setUp(const Vector3& up);

private:
	Vector3 pos, dir, up;
	
	mutable Matrix view;
	mutable bool rebuild_matrix;
};

} // namespace

#endif